import 'dart:convert';

class Policy {
  Policy({
    this.isAdministrator,
    this.isHidden,
    this.isHiddenRemotely,
    this.isDisabled,
    this.blockedTags,
    this.isTagBlockingModeInclusive,
    this.enableUserPreferenceAccess,
    this.accessSchedules,
    this.blockUnratedItems,
    this.enableRemoteControlOfOtherUsers,
    this.enableSharedDeviceControl,
    this.enableRemoteAccess,
    this.enableLiveTvManagement,
    this.enableLiveTvAccess,
    this.enableMediaPlayback,
    this.enableAudioPlaybackTranscoding,
    this.enableVideoPlaybackTranscoding,
    this.enablePlaybackRemuxing,
    this.enableContentDeletion,
    this.enableContentDeletionFromFolders,
    this.enableContentDownloading,
    this.enableSubtitleDownloading,
    this.enableSubtitleManagement,
    this.enableSyncTranscoding,
    this.enableMediaConversion,
    this.enabledDevices,
    this.enableAllDevices,
    this.enabledChannels,
    this.enableAllChannels,
    this.enabledFolders,
    this.enableAllFolders,
    this.invalidLoginAttemptCount,
    this.enablePublicSharing,
    this.remoteClientBitrateLimit,
    this.authenticationProviderId,
    this.excludedSubFolders,
    this.disablePremiumFeatures,
    this.simultaneousStreamLimit,
  });

  bool isAdministrator;
  bool isHidden;
  bool isHiddenRemotely;
  bool isDisabled;
  List<dynamic> blockedTags;
  bool isTagBlockingModeInclusive;
  bool enableUserPreferenceAccess;
  List<dynamic> accessSchedules;
  List<dynamic> blockUnratedItems;
  bool enableRemoteControlOfOtherUsers;
  bool enableSharedDeviceControl;
  bool enableRemoteAccess;
  bool enableLiveTvManagement;
  bool enableLiveTvAccess;
  bool enableMediaPlayback;
  bool enableAudioPlaybackTranscoding;
  bool enableVideoPlaybackTranscoding;
  bool enablePlaybackRemuxing;
  bool enableContentDeletion;
  List<dynamic> enableContentDeletionFromFolders;
  bool enableContentDownloading;
  bool enableSubtitleDownloading;
  bool enableSubtitleManagement;
  bool enableSyncTranscoding;
  bool enableMediaConversion;
  List<dynamic> enabledDevices;
  bool enableAllDevices;
  List<dynamic> enabledChannels;
  bool enableAllChannels;
  List<String> enabledFolders;
  bool enableAllFolders;
  int invalidLoginAttemptCount;
  bool enablePublicSharing;
  int remoteClientBitrateLimit;
  String authenticationProviderId;
  List<dynamic> excludedSubFolders;
  bool disablePremiumFeatures;
  int simultaneousStreamLimit;

  factory Policy.fromRawJson(String str) => Policy.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory Policy.fromJson(Map<String, dynamic> json) => Policy(
        isAdministrator: json["IsAdministrator"],
        isHidden: json["IsHidden"],
        isHiddenRemotely: json["IsHiddenRemotely"],
        isDisabled: json["IsDisabled"],
        blockedTags: List<dynamic>.from(json["BlockedTags"].map((x) => x)),
        isTagBlockingModeInclusive: json["IsTagBlockingModeInclusive"],
        enableUserPreferenceAccess: json["EnableUserPreferenceAccess"],
        accessSchedules: List<dynamic>.from(json["AccessSchedules"].map((x) => x)),
        blockUnratedItems: List<dynamic>.from(json["BlockUnratedItems"].map((x) => x)),
        enableRemoteControlOfOtherUsers: json["EnableRemoteControlOfOtherUsers"],
        enableSharedDeviceControl: json["EnableSharedDeviceControl"],
        enableRemoteAccess: json["EnableRemoteAccess"],
        enableLiveTvManagement: json["EnableLiveTvManagement"],
        enableLiveTvAccess: json["EnableLiveTvAccess"],
        enableMediaPlayback: json["EnableMediaPlayback"],
        enableAudioPlaybackTranscoding: json["EnableAudioPlaybackTranscoding"],
        enableVideoPlaybackTranscoding: json["EnableVideoPlaybackTranscoding"],
        enablePlaybackRemuxing: json["EnablePlaybackRemuxing"],
        enableContentDeletion: json["EnableContentDeletion"],
        enableContentDeletionFromFolders: List<dynamic>.from(json["EnableContentDeletionFromFolders"].map((x) => x)),
        enableContentDownloading: json["EnableContentDownloading"],
        enableSubtitleDownloading: json["EnableSubtitleDownloading"],
        enableSubtitleManagement: json["EnableSubtitleManagement"],
        enableSyncTranscoding: json["EnableSyncTranscoding"],
        enableMediaConversion: json["EnableMediaConversion"],
        enabledDevices: List<dynamic>.from(json["EnabledDevices"].map((x) => x)),
        enableAllDevices: json["EnableAllDevices"],
        enabledChannels: List<dynamic>.from(json["EnabledChannels"].map((x) => x)),
        enableAllChannels: json["EnableAllChannels"],
        enabledFolders: List<String>.from(json["EnabledFolders"].map((x) => x)),
        enableAllFolders: json["EnableAllFolders"],
        invalidLoginAttemptCount: json["InvalidLoginAttemptCount"],
        enablePublicSharing: json["EnablePublicSharing"],
        remoteClientBitrateLimit: json["RemoteClientBitrateLimit"],
        authenticationProviderId: json["AuthenticationProviderId"],
        excludedSubFolders: List<dynamic>.from(json["ExcludedSubFolders"].map((x) => x)),
        disablePremiumFeatures: json["DisablePremiumFeatures"],
        simultaneousStreamLimit: json["SimultaneousStreamLimit"],
      );

  Map<String, dynamic> toJson() => {
        "IsAdministrator": isAdministrator,
        "IsHidden": isHidden,
        "IsHiddenRemotely": isHiddenRemotely,
        "IsDisabled": isDisabled,
        "BlockedTags": List<dynamic>.from(blockedTags.map((x) => x)),
        "IsTagBlockingModeInclusive": isTagBlockingModeInclusive,
        "EnableUserPreferenceAccess": enableUserPreferenceAccess,
        "AccessSchedules": List<dynamic>.from(accessSchedules.map((x) => x)),
        "BlockUnratedItems": List<dynamic>.from(blockUnratedItems.map((x) => x)),
        "EnableRemoteControlOfOtherUsers": enableRemoteControlOfOtherUsers,
        "EnableSharedDeviceControl": enableSharedDeviceControl,
        "EnableRemoteAccess": enableRemoteAccess,
        "EnableLiveTvManagement": enableLiveTvManagement,
        "EnableLiveTvAccess": enableLiveTvAccess,
        "EnableMediaPlayback": enableMediaPlayback,
        "EnableAudioPlaybackTranscoding": enableAudioPlaybackTranscoding,
        "EnableVideoPlaybackTranscoding": enableVideoPlaybackTranscoding,
        "EnablePlaybackRemuxing": enablePlaybackRemuxing,
        "EnableContentDeletion": enableContentDeletion,
        "EnableContentDeletionFromFolders": List<dynamic>.from(enableContentDeletionFromFolders.map((x) => x)),
        "EnableContentDownloading": enableContentDownloading,
        "EnableSubtitleDownloading": enableSubtitleDownloading,
        "EnableSubtitleManagement": enableSubtitleManagement,
        "EnableSyncTranscoding": enableSyncTranscoding,
        "EnableMediaConversion": enableMediaConversion,
        "EnabledDevices": List<dynamic>.from(enabledDevices.map((x) => x)),
        "EnableAllDevices": enableAllDevices,
        "EnabledChannels": List<dynamic>.from(enabledChannels.map((x) => x)),
        "EnableAllChannels": enableAllChannels,
        "EnabledFolders": List<dynamic>.from(enabledFolders.map((x) => x)),
        "EnableAllFolders": enableAllFolders,
        "InvalidLoginAttemptCount": invalidLoginAttemptCount,
        "EnablePublicSharing": enablePublicSharing,
        "RemoteClientBitrateLimit": remoteClientBitrateLimit,
        "AuthenticationProviderId": authenticationProviderId,
        "ExcludedSubFolders": List<dynamic>.from(excludedSubFolders.map((x) => x)),
        "DisablePremiumFeatures": disablePremiumFeatures,
        "SimultaneousStreamLimit": simultaneousStreamLimit,
      };

  @override
  String toString() {
    return 'Policy{isAdministrator: $isAdministrator, isHidden: $isHidden, isHiddenRemotely: $isHiddenRemotely, isDisabled: $isDisabled, blockedTags: $blockedTags, isTagBlockingModeInclusive: $isTagBlockingModeInclusive, enableUserPreferenceAccess: $enableUserPreferenceAccess, accessSchedules: $accessSchedules, blockUnratedItems: $blockUnratedItems, enableRemoteControlOfOtherUsers: $enableRemoteControlOfOtherUsers, enableSharedDeviceControl: $enableSharedDeviceControl, enableRemoteAccess: $enableRemoteAccess, enableLiveTvManagement: $enableLiveTvManagement, enableLiveTvAccess: $enableLiveTvAccess, enableMediaPlayback: $enableMediaPlayback, enableAudioPlaybackTranscoding: $enableAudioPlaybackTranscoding, enableVideoPlaybackTranscoding: $enableVideoPlaybackTranscoding, enablePlaybackRemuxing: $enablePlaybackRemuxing, enableContentDeletion: $enableContentDeletion, enableContentDeletionFromFolders: $enableContentDeletionFromFolders, enableContentDownloading: $enableContentDownloading, enableSubtitleDownloading: $enableSubtitleDownloading, enableSubtitleManagement: $enableSubtitleManagement, enableSyncTranscoding: $enableSyncTranscoding, enableMediaConversion: $enableMediaConversion, enabledDevices: $enabledDevices, enableAllDevices: $enableAllDevices, enabledChannels: $enabledChannels, enableAllChannels: $enableAllChannels, enabledFolders: $enabledFolders, enableAllFolders: $enableAllFolders, invalidLoginAttemptCount: $invalidLoginAttemptCount, enablePublicSharing: $enablePublicSharing, remoteClientBitrateLimit: $remoteClientBitrateLimit, authenticationProviderId: $authenticationProviderId, excludedSubFolders: $excludedSubFolders, disablePremiumFeatures: $disablePremiumFeatures, simultaneousStreamLimit: $simultaneousStreamLimit}';
  }
}
